<script lang="ts" setup>
import useEcharts from '@/hooks/useEcharts'
import { downloadPng } from './downloadpng'
const chartId = "lineChart";
const options = {
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  tooltip: {
    trigger: 'axis', // 触发类型，可选：'item'（数据项图形触发），'axis'（坐标轴触发）
    axisPointer: {
      type: 'cross', // 指示器类型，可选：'line'（直线指示器），'shadow'（阴影指示器），'cross'（十字准星指示器）
      crossStyle: {
        color: '#999'
      }
    }
  },
  series: [
    {
      data: [820, 932, 901, 934, 1290, 1330, 1320],
      type: 'line',
      smooth: true
    }
  ]
};
const { chart, updateChart } = useEcharts(chartId, options);

//下载图表
const downloadEchart = () => {

}

</script>

<template>
  <el-card style="width: 480px">
    <template #header>
      <div class="card-header">
        <span>业绩折线图</span>
      </div>
    </template>
    <div :id="chartId" :style="{ width: '440px', height: '400px' }"></div>

  </el-card>
</template>

<style scoped lang="scss">
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>